// pages/thetext/thetext.js
var util = require("../../utils/util.js")
var api = require("../../utils/api.js")
var app = getApp();
var WxParse = require('../../utils/wxParse/wxParse.js');
Page({

	/**
	 * 页面的初始数据
	 */
	data: {
		// type:0,
		articelinfo: {},
		resBaseUrl:'',
	},
    
	/**
	 * 生命周期函数--监听页面加载
	 */
	onLoad: function (options) {
		var that=this
		that.setData({
			resBaseUrl: app.globalData.resBaseUrl,
		})
		let data = { id: options.id}
		let url = app.globalData.resBaseUrl + app.u.ARTICELINFO
		api.requestUrl(data, url).then(res => {
			console.log(res.data.content)
			WxParse.wxParse('content', 'html', res.data.content, that, 5);
			that.setData({
				articelinfo: res.data,
			    // type:type,
			})
		})
	},

	/**
	 * 生命周期函数--监听页面显示
	 */
	onShow: function () {

		wx.showShareMenu({
			withShareTicket: true
		}) 
	},
})